/* Ejercicio 3.20
   ejer3_20.c */
#include <stdio.h>

/* funcion main, el programa inicia aca */
int main( void )
{
    float principal, rate, charge;
    int days;

    printf( "Enter loan principal (-1 to end): " );
    scanf( "%f", &principal );

    while ( principal >= 0 ) {
        printf( "Enter interest rate: " );
        scanf( "%f", &rate );
        printf( "Enter term of the loan in days: " );
        scanf( "%d", &days );
        charge = principal * rate * days / 365;
        printf( "The interest charge is $%.2f\n\n", charge );
        printf( "Enter loan principal (-1 to end): " );
        scanf( "%f", &principal );
    }
	return 0;
} /* fin de la funcion main */
